package org.qiuer.func.function.array;

import org.qiuer.func.AMemberFunction;
import org.qiuer.run.Context;
import org.qiuer.exception.IException;

import java.util.List;

public class ArrayLengthFunction extends AMemberFunction<List> {

  public ArrayLengthFunction() {
    this.propertyCall = true;
  }

  @Override
  public Object run(List member, Context context, Object... args) throws IException {
    return member.size();
  }

  @Override
  public String getName() {
    return "length";
  }

}
